<div class="row-fluid">
  <div class="span12" id="areaImprimir">
    <div class="span6">
		<div class="alert alert-block alert-error fade in">
		<a href="#" data-dismiss="alert" class="close">x</a>
		<h4 class="alert-heading">
			Generar Calendario Academico
		</h4>
			<ul>
				<li>
				Registrar Nueva Evaluacion Academica por cada Ciclo.
		      	</li>
				</ul>
				<p>
				    <a href="<?php echo $this->Html->url(array('action'=>'add')) ?>" class="btn btn-inverse"><i class="splashy-check"></i> Registrar Nueva Evaluacion</a>
				</p>
		</div>
    </div>
    <div class="span4">
		<div id="cargaDatos">
		</div>
		<div class="alert alert-block alert-warning fade in">
		<h4 class="alert-heading">
		Envio por Correo Electronico 
		</h4>
		<p>
		Desde el pie de pagina en <b>"Envio por Correo"</b> seleccione el ciclo para el envio del Rol de Examenes a los Padres de Familia.
		</p>
		
	    </div>
    </div>
                <div class="span10">
  	<h2>Calendario Acad&eacute;mico</h2>
	<table class="table table-striped table-bordered dTableR" id="dt_a">
    <thead>
	<tr>
			<th>Item</th>
            <th>Ciclo</th>
            <th>Nivel</th>
			<th>Evaluacion</th>
			<th>Incio</th>
			<th>Finalizaci&oacute;n</th>
			<th>Gestion</th>
			<th class="actions">acciones</th>
	</tr>
    </thead>
    <tbody>
	<?php
    $i=1;
	foreach ($calendarios as $calendario): ?>
	<tr>
		<td><?php echo $i;$i++; //echo h($calendario['Calendario']['id']); ?>&nbsp;</td>
        <td><?php echo h($calendario['Ciclo']['nombre']); ?>&nbsp;</td>
        <td><?php echo h($calendario['Calendario']['nivel']); ?>&nbsp;</td>
		<td><?php echo h($calendario['Calendario']['evaluacion']); ?>&nbsp;</td>
		<td><?php echo h($calendario['Calendario']['fecha_inicio']); ?>&nbsp;</td>
		<td><?php echo h($calendario['Calendario']['fecha_fin']); ?>&nbsp;</td>
		<td><?php echo h($calendario['Calendario']['gestion']); ?>&nbsp;</td>
		<td class="actions">
            <?php echo $this->Html->image("iconos/edit.png", array("title" => "Editar",'url' => array('action' => 'edit',$calendario['Calendario']['id'])));?> 
            <?php echo $this->Html->link($this->Html->image("iconos/elim.png"), array('action' => 'delete', $calendario['Calendario']['id']), array('escape' => false), "Esta seguro de eliminar este dato?");?>

            <?php //echo $this->Html->link(__('View'), array('action' => 'view', $calendario['Calendario']['id'])); ?>
			<?php //echo $this->Html->link(__('Edit'), array('action' => 'edit', $calendario['Calendario']['id'])); ?>
			<?php //echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $calendario['Calendario']['id']), null, __('Are you sure you want to delete # %s?', $calendario['Calendario']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</tbody>
	</table>
<div class="clear">
        &nbsp;
</div>



</div>
<div class="clear">&nbsp;
				</div>
                <div class="row-fluid">
                <div class="span6">
                
                <?php echo $this->Html->link(
        'Registrar nueva evaluacion',
        array('action'=>'add'),
        array('class'=>'btn btn-gebo')
        ); 
?>
                

						<button class="btn btn-gebo" id="btnImprimir">
							Imprimir
						</button>
					
				</div>
                
                <div class="span6" id="cargaImprimirEnviar">
                
                <?php echo $this->Form->create('Calendarios',array('action'=>'enviocorreos','class'=>"well form-inline")) ?>
									
										<p class="f_legend">Enviar por correo</p>
										<select name="data[Calendario][ciclo_id]" id="chosen_c" data-placeholder="Eliga un ciclo..." class="chzn_b" "required"='required'>
							<option value="">
							</option>
							<?php foreach($ciclos as $ciclo):?>
								<option value="<?php echo $ciclo['Ciclo']['id'] ?>">
									<?php echo $ciclo[ 'Ciclo'][ 'nombre'] ?>
								</option>
								<?php endforeach; ?>
						</select>
										
										
                  
						<button class="btn" type="submit">Enviar</button>
         
                </div>
                </div>
				
                
                
<script type="text/javascript">
					
   $(document).ready(function() {

         $("#btnImprimir").click(function() {
             printElem({ leaveOpen: true, printMode: 'popup' });
             //printElem({ overrideElementCSS: ['/colegio/css/print.css'] });
         });
     });
 function printElem(options){
     $('#areaImprimir').printElement(options);
 }

 
				</script>
</div>
<!-- sidebar -->
<?php echo $this->element('sidebar/calendario'); ?>
<!-- fin sidebar -->
<?php //llamamos scripts tablas ?>
<?php echo $this->element('jstablas'); ?>
